package syswk.com.tanksgame;

import java.awt.*;

/**
 * 作者：swk
 * 时间：
 * 公司：
 **/
@SuppressWarnings({"all"})
public class Tank {
    private int x; //坦克横坐标
    private int y; //坦克纵坐标
    private int direct; //坦克方向 0 上 1 右 2 下 3 左
    private Boolean lift; //坦克生命
    private Color color;  //坦克的颜色涂装
    private int speed = 10;//坦克行驶速度，初始化为2

    public int getSpeed() {
        return speed;
    }

    public void setSpeed(int speed) {
        this.speed = speed;
    }

    public Tank(int x, int y, int direct, Boolean lift, Color color) {
        this.x = x;
        this.y = y;
        this.direct = direct;
        this.lift = lift;
        this.color = color;
    }

    public Boolean getLift() {
        return lift;
    }

    public void setLift(Boolean lift) {
        this.lift = lift;
    }

    public Color getColor() {
        return color;
    }

    public void setColor(Color color) {
        this.color = color;
    }

    public int getDirect() {
        return direct;
    }

    public void setDirect(int direct) {
        this.direct = direct;
    }

    public int getX() {
        return x;
    }

    public void setX(int x) {
        this.x = x;
    }

    public int getY() {
        return y;
    }

    public void setY(int y) {
        this.y = y;
    }

    public void moveUp() {
        y -= speed;
    }

    public void moveDown() {
        y += speed;
    }

    public void moveRight() {
        x += speed;
    }

    public void moveLeft() {
        x -= speed;
    }

}
